#!/bin/bash
echo "begin to build roboeffect_demo: $#"
workdir=$(cd $(dirname $0); pwd)
echo "$workdir"
if [ $# -ge 1 ]
then
	if [ "$1" = "build" ]
	then
		echo "build"
    mkdir efuse_auto
		chmod +x ./tools/makefile_gen
		chmod +x ./tools/adapt_files_gen
		nds_ldsag -t $ANDES_COMPILE_UTILS/nds32_template.txt nds32-ae210p.sag -o nds32-ae210p.ld
		./tools/adapt_files_gen -i middleware/roboeffect/graphics/ -o main/
		./tools/makefile_gen -i makefile.ini -d ./
		cd ./efuse_auto
		make all
		cd $workdir 
	elif [ "$1" = "clean" ]
	then
		echo "clean"
		cd ./efuse_auto
		make clean
		cd $workdir
	elif [ "$1" = "release" ]
	then
		:
	else
		:
	fi
else
	echo "parameters error! [build][clean][copy]"
fi